//
//  XFXTopicHeaderView.m
//  XFXnews
//
//  Created by dllo on 16/1/30.
//  Copyright © 2016年 lanou. All rights reserved.
//

#import "XFXTopicHeaderView.h"


@interface XFXTopicHeaderView()

@property (nonatomic, strong)UIImageView *myImage;
@property (nonatomic, strong)UILabel *tittleLabel;
@property (nonatomic, strong)UILabel *myLabel;



@end


@implementation XFXTopicHeaderView


- (instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        [self createSubViews];
    }
    return self;
}

- (void)createSubViews{
    self.backgroundColor = [UIColor whiteColor];
    self.myImage = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, XFXWIDTH, XFXHEIGHT/3)];
    [self addSubview:self.myImage];
    
    self.tittleLabel = [[UILabel alloc]initWithFrame:CGRectMake((XFXWIDTH - 300*XFXWIDTH/414)/2, 100*XFXHEIGHT/736, 300*XFXWIDTH/414, 100*XFXHEIGHT/736)];
    [self addSubview:self.tittleLabel];
    self.tittleLabel.textColor = [UIColor whiteColor];
    self.tittleLabel.numberOfLines = 0;
    
    self.myLabel = [[UILabel alloc]initWithFrame:CGRectMake((XFXWIDTH - 100*XFXHEIGHT/736)/2, 200*XFXHEIGHT/736, 100*XFXWIDTH/414, 50*XFXHEIGHT/736)];
    [self addSubview:self.myLabel];
    self.myLabel.textColor = [UIColor whiteColor];
    self.myLabel.font = [UIFont systemFontOfSize:13];
}



- (void)setModel:(XFXTopicDetaHeaderModel *)model{
    _model = model;
    
    NSURL *url = [NSURL URLWithString:_model.picurl];
    [self.myImage sd_setImageWithURL:url placeholderImage:[UIImage imageNamed:@"u=659450849,1336395635&fm=21&gp=0"]];
    
    self.tittleLabel.text = _model.alias;
    
    NSString *str = [NSString stringWithFormat:@"%@ 关注", _model.concernCount];
    self.myLabel.text = str;
    
    
    
}
@end
